package com.zzz.gp.bean;

import org.I0Itec.zkclient.exception.ZkMarshallingError;
import org.I0Itec.zkclient.serialize.ZkSerializer;

/**
 * @description:
 * @author: ZZZ
 * @time: 2021/3/21 19:49
 */
public class MyZkSerializer implements ZkSerializer {
    //序列化，数据--》byte[]
    public byte[] serialize(Object o) throws ZkMarshallingError {
        return String.valueOf(o).getBytes();

    }
    //反序列化，byte[]--->数据
    public Object deserialize(byte[] bytes) throws ZkMarshallingError {
        return new String(bytes);
    }


}
